import { defineStore } from 'pinia'

export const useArticleStore = defineStore('useArticleStore', {

    state: () => {
        return {
            title: '发布',
            articleValue: {},
            id: -1
        }
    },
    getters: {
        getTitle(state) {
            return state.title
        },
        getArticleValue(state) {
            return state.articleValue
        },
    },
    actions: {
        setTitle(val) {
            this.title = val
        },
        setArticleValue(val) {
            this.articleValue = val
        },
        setId(val) {
            this.id = val
        },
        reset() {
            this.title = '发布'
            this.articleValue = {}
            this.id = -1
        }
    },
})